#!/user/bin/env node

//const usr = "liubangling",
//      pwd = "123456";

//const usr_pwd = `${usr}:${pwd}`;
//const buf = Buffer.from(usr_pwd);
//console.log(buf.toString('base64'));


const log = console.log,
      usr = process.argv[2],
      pwd = process.argv[3];

if(process.argv.length != 4){
  console.error('命令行格式：cmd user_name password');
  process.exit(1);
}

log('username:%s\npassword:%s', usr, pwd);

const buf = Buffer.from(usr + ':' + pwd);
log('Base64:',buf.toString('Base64'));
